\hypertarget{classsc2_1_1_query_interface}{}\section{sc2\+:\+:Query\+Interface Class Reference}
\label{classsc2_1_1_query_interface}\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}


{\ttfamily \#include $<$sc2\+\_\+interfaces.\+h$>$}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structsc2_1_1_query_interface_1_1_pathing_query}{Pathing\+Query}
\item 
struct \hyperlink{structsc2_1_1_query_interface_1_1_placement_query}{Placement\+Query}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual \hyperlink{structsc2_1_1_available_abilities}{Available\+Abilities} \hyperlink{classsc2_1_1_query_interface_a6954d65b93a07bf14e2a8818f9df9b8c}{Get\+Abilities\+For\+Unit} (Tag tag, bool ignore\+\_\+resource\+\_\+requirements=false)=0
\item 
virtual std\+::vector$<$ \hyperlink{structsc2_1_1_available_abilities}{Available\+Abilities} $>$ \hyperlink{classsc2_1_1_query_interface_a6add52c8b04f0e50efdd83955952b76f}{Get\+Abilities\+For\+Units} (const std\+::vector$<$ Tag $>$ \&tags, bool ignore\+\_\+resource\+\_\+requirements=false)=0
\item 
virtual float \hyperlink{classsc2_1_1_query_interface_adf72c7556e59e82e231d9c58bd093546}{Pathing\+Distance} (const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&start, const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&end)=0
\item 
virtual float \hyperlink{classsc2_1_1_query_interface_a1a7216c7ad37273dc54e12a92fee7a64}{Pathing\+Distance} (const Tag \&start\+\_\+unit\+\_\+tag, const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&end)=0
\item 
\mbox{\Hypertarget{classsc2_1_1_query_interface_ae23848466df99bfb7c3da9fbabc7f47b}\label{classsc2_1_1_query_interface_ae23848466df99bfb7c3da9fbabc7f47b}} 
virtual std\+::vector$<$ float $>$ \hyperlink{classsc2_1_1_query_interface_ae23848466df99bfb7c3da9fbabc7f47b}{Pathing\+Distance} (const std\+::vector$<$ \hyperlink{structsc2_1_1_query_interface_1_1_pathing_query}{Pathing\+Query} $>$ \&queries)=0
\begin{DoxyCompactList}\small\item\em Issues multiple pathing queries. \end{DoxyCompactList}\item 
virtual bool \hyperlink{classsc2_1_1_query_interface_ae78a9660fc9f03b1676bacf47c9a9180}{Placement} (const \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} \&ability, const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&target\+\_\+pos, Tag placing\+\_\+unit\+\_\+tag\+\_\+=Null\+Tag)=0
\item 
virtual std\+::vector$<$ bool $>$ \hyperlink{classsc2_1_1_query_interface_a470e79785e2ffdb1a5c4636c8a070601}{Placement} (const std\+::vector$<$ \hyperlink{structsc2_1_1_query_interface_1_1_placement_query}{Placement\+Query} $>$ \&queries)=0
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \hyperlink{classsc2_1_1_query_interface}{Query\+Interface} provides additional data not contained in the observation.

Performance note\+:
\begin{DoxyItemize}
\item Always try and batch things up. These queries are effectively synchronous and will block until returned. 
\end{DoxyItemize}

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classsc2_1_1_query_interface_a6954d65b93a07bf14e2a8818f9df9b8c}\label{classsc2_1_1_query_interface_a6954d65b93a07bf14e2a8818f9df9b8c}} 
\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}!Get\+Abilities\+For\+Unit@{Get\+Abilities\+For\+Unit}}
\index{Get\+Abilities\+For\+Unit@{Get\+Abilities\+For\+Unit}!sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}
\subsubsection{\texorpdfstring{Get\+Abilities\+For\+Unit()}{GetAbilitiesForUnit()}}
{\footnotesize\ttfamily virtual \hyperlink{structsc2_1_1_available_abilities}{Available\+Abilities} sc2\+::\+Query\+Interface\+::\+Get\+Abilities\+For\+Unit (\begin{DoxyParamCaption}\item[{Tag}]{tag,  }\item[{bool}]{ignore\+\_\+resource\+\_\+requirements = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Returns a list of abilities represented as a uint32\+\_\+t see the A\+B\+I\+L\+I\+T\+Y\+\_\+\+ID enum for their corresponding, named, representations. 
\begin{DoxyParams}{Parameters}
{\em tag} & Tag of unit. \\
\hline
{\em ignore\+\_\+resource\+\_\+requirements} & Ignores food, mineral and gas costs, as well as cooldowns. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Abilities for the unit. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_query_interface_a6add52c8b04f0e50efdd83955952b76f}\label{classsc2_1_1_query_interface_a6add52c8b04f0e50efdd83955952b76f}} 
\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}!Get\+Abilities\+For\+Units@{Get\+Abilities\+For\+Units}}
\index{Get\+Abilities\+For\+Units@{Get\+Abilities\+For\+Units}!sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}
\subsubsection{\texorpdfstring{Get\+Abilities\+For\+Units()}{GetAbilitiesForUnits()}}
{\footnotesize\ttfamily virtual std\+::vector$<$\hyperlink{structsc2_1_1_available_abilities}{Available\+Abilities}$>$ sc2\+::\+Query\+Interface\+::\+Get\+Abilities\+For\+Units (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ Tag $>$ \&}]{tags,  }\item[{bool}]{ignore\+\_\+resource\+\_\+requirements = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Issues multiple available abilities queries. Batch version. 
\begin{DoxyParams}{Parameters}
{\em tag} & Tags of units. \\
\hline
{\em ignore\+\_\+resource\+\_\+requirements} & Ignores food, mineral and gas costs, as well as cooldowns. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Abilities for the units. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_query_interface_adf72c7556e59e82e231d9c58bd093546}\label{classsc2_1_1_query_interface_adf72c7556e59e82e231d9c58bd093546}} 
\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}!Pathing\+Distance@{Pathing\+Distance}}
\index{Pathing\+Distance@{Pathing\+Distance}!sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}
\subsubsection{\texorpdfstring{Pathing\+Distance()}{PathingDistance()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily virtual float sc2\+::\+Query\+Interface\+::\+Pathing\+Distance (\begin{DoxyParamCaption}\item[{const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&}]{start,  }\item[{const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&}]{end }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Returns pathing distance between two locations. Takes into account unit movement properties (e.\+g. Flying). 
\begin{DoxyParams}{Parameters}
{\em start} & Starting point. \\
\hline
{\em end} & End point. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Distance between the two points. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_query_interface_a1a7216c7ad37273dc54e12a92fee7a64}\label{classsc2_1_1_query_interface_a1a7216c7ad37273dc54e12a92fee7a64}} 
\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}!Pathing\+Distance@{Pathing\+Distance}}
\index{Pathing\+Distance@{Pathing\+Distance}!sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}
\subsubsection{\texorpdfstring{Pathing\+Distance()}{PathingDistance()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily virtual float sc2\+::\+Query\+Interface\+::\+Pathing\+Distance (\begin{DoxyParamCaption}\item[{const Tag \&}]{start\+\_\+unit\+\_\+tag,  }\item[{const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&}]{end }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Returns pathing distance between a unit and a target location. Takes into account unit movement properties (e.\+g. Flying). Batch version. 
\begin{DoxyParams}{Parameters}
{\em start} & Starting points. \\
\hline
{\em end} & End points. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Distances between the two points. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_query_interface_ae78a9660fc9f03b1676bacf47c9a9180}\label{classsc2_1_1_query_interface_ae78a9660fc9f03b1676bacf47c9a9180}} 
\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}!Placement@{Placement}}
\index{Placement@{Placement}!sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}
\subsubsection{\texorpdfstring{Placement()}{Placement()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily virtual bool sc2\+::\+Query\+Interface\+::\+Placement (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} \&}]{ability,  }\item[{const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&}]{target\+\_\+pos,  }\item[{Tag}]{placing\+\_\+unit\+\_\+tag\+\_\+ = {\ttfamily NullTag} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Returns whether a building can be placed at a location. The placing unit field is optional. This is only used for cases where the placing unit plays a role in the placement grid test (e.\+g. A flying barracks building an add-\/on requires room for both the barracks and add-\/on). 
\begin{DoxyParams}{Parameters}
{\em ability} & Ability for building or moving a structure. \\
\hline
{\em end} & target\+\_\+pos Position to attempt placement on. \\
\hline
{\em placing\+\_\+unit\+\_\+tag\+\_\+} & (Optional) The unit that is moving, if moving a structure. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
If placement is possible. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_query_interface_a470e79785e2ffdb1a5c4636c8a070601}\label{classsc2_1_1_query_interface_a470e79785e2ffdb1a5c4636c8a070601}} 
\index{sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}!Placement@{Placement}}
\index{Placement@{Placement}!sc2\+::\+Query\+Interface@{sc2\+::\+Query\+Interface}}
\subsubsection{\texorpdfstring{Placement()}{Placement()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily virtual std\+::vector$<$bool$>$ sc2\+::\+Query\+Interface\+::\+Placement (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ \hyperlink{structsc2_1_1_query_interface_1_1_placement_query}{Placement\+Query} $>$ \&}]{queries }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

A batch version of the above Placement query. Takes an array of abilities, positions and optional unit tags and returns a matching array of bools indicating if placement is possible. 
\begin{DoxyParams}{Parameters}
{\em queries} & Placement queries. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Array of bools indicating if placement is possible. 
\end{DoxyReturn}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/sc2api/\hyperlink{sc2__interfaces_8h}{sc2\+\_\+interfaces.\+h}\end{DoxyCompactItemize}
